package com.zhijian.warehouse.manage.dao;


import com.zhijian.warehouse.manage.entity.po.Role;
import com.zhijian.warehouse.manage.entity.vo.request.RoleSearchVo;
import com.zhijian.warehouse.manage.entity.vo.response.RoleVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoleMapper {
    int deleteByPrimaryKey(Long id);

    /**
     * 按照主键批量删除
     *
     * @param idList
     * @return
     */
    int deleteByIdList(@Param("idList") List<Long> idList);

    int insert(Role record);

    int insertSelective(Role record);

    Role selectByPrimaryKey(Long id);

    /**
     * 根据用户ID查询vo类
     *
     * @param userId
     * @return
     */
    RoleVo selectByUserId(Long userId);

    int updateByPrimaryKeySelective(Role record);

    int updateByPrimaryKey(Role record);

    int count(RoleSearchVo roleSearchVo);

    List<RoleVo> selectList(RoleSearchVo roleSearchVo);

    RoleVo selectVoById(Long id);

    /**
     * 根据名称查询
     *
     * @param name
     * @return
     */
    RoleVo selectVoByName(String name);

    /**
     * 根据code查询
     *
     * @param code
     * @return
     */
    RoleVo selectVoByCode(String code);

    int insertBatch(@Param("entities") List<Role> entities);
}